home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 61 / 061.d81 / ml relocater (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  177 lines

  1. 10 clr:print"[147]":poke53280,0:poke53281,0
  2. 20 open1,0:dim nc(60),c2(110),n2(110),ab(40),ae(40)
  3. 25 gosub61000:print"[147]"chr$(142)chr$(8)
  4. 30 printtab(7)"[176][174]                     [176][174]"
  5. 40 printtab(7)"[173][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][189]"
  6. 50 printtab(7)" [221]   [158] ml re-locater    [221] "
  7. 60 printtab(7)" [221]                     [221]"
  8. 70 printtab(7)" [221][159]  by:jeff babuschak  [221]"
  9. 80 printtab(7)"[176][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][174]"
  10. 90 printtab(7)"[173][189]                     [173][189]"
  11. 100 fora=1to20:print"[209][158][209]";:nexta
  12. 110 gosub480
  13. 120 print"please enter new starting address:";:input#1,ns$
  14. 130 print:print"are you sure? [y/n/q]:";:input#1,s$:print
  15. 140 ns=val(ns$):ifns=0then120
  16. 145 ifs$="q"then1400
  17. 150 ifs$<>"y"ands$<>"n"then120
  18. 160 ifs$="n"then120
  19. 170 fora=1to20:print"[209][158][209]";:nexta:print
  20. 180 print"does this program contain data? [y/n/m]:";
  21. 190 input#1,da$
  22. 200 ifda$<>"y"andda$<>"n"andda$<>"m"then180
  23. 210 print:print"are you sure? [y/n/q]:";:input#1,s$:print
  24. 215 ifs$="q"then1400
  25. 220 ifs$<>"y"ands$<>"n"then210
  26. 230 il=-1
  27. 240 ifs$="n"then180
  28. 250 ifda$="m"then410
  29. 260 ifda$="n"then410
  30. 270 il=il+1:print""
  31. 280 fort=1to14:print"                                       ";:nextt:print
  32. 290 print""
  33. 300 fora=1to20:print"[209][158][209]";:nexta:print
  34. 310 print"[145]enter beginning address:";:input#1,ab$(il):print
  35. 320 print"enter ending address:";:input#1,ae$(il):print
  36. 330 ab(il)=val(ab$(il)):ae(il)=val(ae$(il))
  37. 340 print"are you sure? [y/n/q]:";:input#1,s$:print:print"[145]";
  38. 345 ifs$="q"then1400
  39. 350 ifs$="y"andae(il)=0andab(il)=0then401
  40. 360 ifab(il)>ae(il)then290
  41. 361 ifae(il)<sathen290
  42. 362 ifab(il)<sathen290
  43. 370 ifs$="y"and(ae(il)-ab(il))<1then290
  44. 380 ifs$<>"y"ands$<>"n"then340
  45. 390 ifs$="n"then290
  46. 400 goto 270
  47. 401 print:print"[145][145]"
  48. 410 fora=1to20:print"[209][158][209]";:nexta:print:print"[145][145]";
  49. 420 fort=0toil:ab(t)=abs(val(ab$(t))-sa):ae(t)=abs(val(ae$(t))-sa):nextt
  50. 430 print"enter name of destination file:";:input#1,d$:print
  51. 440 print"[145]";:fora=1to20:print"[209][158][209]";:nexta:print
  52. 450 close1:open1,8,1,"@0:"+d$+",p,w":hi=int(ns/256):lo=ns-(hi*256)
  53. 460 print#1,chr$(lo);:print#1,chr$(hi);
  54. 470 mp=11000:mr=12000:goto570
  55. 480 rem *** disk routine ***
  56. 490 print"enter name of ml file:";:input#1,f$:iff$="q"then1400
  57. 500 print:fora=1to20:print"[209][158][209]";:nexta:print
  58. 510 open2,8,2,"0:"+f$:open15,8,15:input#15,a$,b$,c$,d$:ifval(a$)>0then1260
  59. 520 get#2,lo$:get#2,hi$:lo=asc(lo$+chr$(0)):hi=asc(hi$+chr$(0))
  60. 530 sa=hi*256+lo
  61. 540 print"[145]starting address is:"sa
  62. 550 print:print"[145][145]":fora=1to20:print"[209][158][209]";:nexta:print
  63. 560 return
  64. 570 rem *** set-up ***
  65. 580 il=0:read nc(d)
  66. 590 ifnc(d)=999then610
  67. 600 d=d+1:goto580
  68. 610 read c2(d2),n2(d2)
  69. 620 ifc2(d2)=999then640
  70. 630 d2=d2+1:goto610
  71. 640 ea=0
  72. 650 ea=ea+1:get#2,x$:da=asc(x$+chr$(0)):pokeea+mr-1,da:ifst<>0thenclose2
  73. 660 ifst=0then650
  74. 670 r=ea+1
  75. 680 ifda$="n"orda$="y"then810
  76. 690 rem *** check for data ***
  77. 700 da=peek(mr+l+yy):forc=0tod:ifnc(c)=dathenng=ng+3:yy=yy+2
  78. 710 nextc:yy=yy+1:ifyy<5then700
  79. 720 yy=0:print"[158]"l
  80. 730 da=peek(mr+l+yy):forc=0tod2
  81. 740 ifc2(c)=daandn2(c)=2thenng=ng+2:yy=yy+1
  82. 750 ifc2(c)=daandn2(c)=1thenng=ng+1
  83. 760 nextc:yy=yy+1:ifyy<5then730
  84. 770 if(ng/yy)<1thenfort=1toyy:pokemp+l,peek(mr+l):l=l+1:nextt:l=l-1
  85. 780 if(ng/yy)<1andl<rthenyy=0:ng=0:ol=l:goto690
  86. 790 if(ng/yy)<1andl>=rthen1350
  87. 800 ng=0:ol=l:yy=0
  88. 810 rem *** relocation routine ***
  89. 820 ifl=>ab(il)thendi=(ae(il)-ab(il))
  90. 830 ifl=>ab(il)thenfort=0todi:poke(mp+ab(il)+t),peek(mr+ab(il)+t):next
  91. 840 ifl=>ab(il)thenil=il+1:l=t+l
  92. 850 xy=0:print"[158]";l:da=peek(l+mr):forc=0tod
  93. 860 ifnc(c)=dathengosub960
  94. 870 nextc:ifxy=3then930
  95. 880 xy=0:da=peek(mr+l):forg=0tod2
  96. 890 ifc2(g)=daandn2(g)=1thenpokemp+l,da:l=l+1:xy=1
  97. 900 ifc2(g)=daandn2(g)=2thenpokemp+l,da:l=l+1:pokemp+l,peek(mr+l):l=l+1:xy=2
  98. 910 nextg
  99. 920 ifxy=0thenpokemp+l,da:l=l+1
  100. 930 ifl>=rthen1350
  101. 940 ifda$="m"and(l-ol)>=3then700
  102. 950 goto820
  103. 960 rem *** process 3 byte comms. ***
  104. 970 xy=3:l1=peek(l+mr+1):h1=peek(l+mr+2):n=h1*256+l1
  105. 975 ifn<saorn>sa+ea+1thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
  106. 980 ifn>53247orn<2048thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
  107. 990 ifn<49152andn>40959thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
  108. 1000 pokemp+l,da:ifns>=sathennj=(h1*256+l1)+(ns-sa):ifnj>65280thenn=53248:goto980
  109. 1010 ifns<sathennj=((h1*256)+l1)-(sa-ns)
  110. 1020 pokemp+l+2,int(nj/256)
  111. 1030 pokemp+l+1,int(nj-(256*(int(nj/256))))
  112. 1040 pokemp+l,da:l=l+3
  113. 1050 return
  114. 1060 rem *** 3 byte data ***
  115. 1070 data 109,125,121,45,61,57,14
  116. 1080 data 30,44,205,221,217,235,204
  117. 1090 data 206,222,77,93,89,238,254
  118. 1100 data 76,108,32,173,189,185,174
  119. 1110 data 190,172,188,78,94,13,29,25
  120. 1120 data 46,62,110,126,237,235,249
  121. 1130 data 141,157,153,142,140,999
  122. 1140 rem *** 1&2 byte data ***
  123. 1150 data 105,2,101,2,117,2,97,2,113,2,41,2,37,2,53,2,33,2,49,2,10,1,6,2,22,2
  124. 1160 data 144,2,176,2,240,2,36,2,48,2,208,2
  125. 1170 data 16,2,0,1,80,2,112,2,24,1,216,1,88,1,184,1,201,2,197,2,213,2,193,2
  126. 1180 data 209,2,224,2,228,2,192,2,196,2,198,2
  127. 1190 data 214,2,202,1,136,1,73,2,69,2,85,2,65,2,81,2,230,2,246,2,232,1,200,1
  128. 1200 data 169,2,165,2,181,2,161,2,177,2
  129. 1210 data 162,2,166,2,182,2,160,2,164,2,180,2,74,2,70,2,86,2,234,1
  130. 1220 data 9,2,5,2,21,2,1,2,17,2,72,1,8,1,104,1,40,1,42,1
  131. 1230 data 38,2,54,2,106,1,102,2,118,2,64,1,96,1,233,2,229,2,245,2,225,2
  132. 1240 data 241,2,56,1,248,1,120,1,133,2,149,2,129,2
  133. 1250 data 145,2,134,2,150,2,132,2,148,2,170,1,168,1,186,1,138,1,154,1,152,1,999,0
  134. 1260 rem *** error routine ***
  135. 1270 print"io/error[146]:";a$;",";b$;",";c$;",";d$
  136. 1280 close1:close2:close15
  137. 1290 poke54276,0:s=54272:v=s+24:pokev,4
  138. 1300 pokes+5,0:pokes+6,15*16:pokes+4,33
  139. 1310 pokes,4:pokes+1,48:fora=0to350:next:pokes,2:pokes+1,24:fora=0to350:next
  140. 1320 pokev,0:print:printtab(8)"[158]press any key to restart"
  141. 1330 ifpeek(197)<>64thenpoke198,0:run
  142. 1340 goto1330
  143. 1350 rem *** close disk ***
  144. 1360 fora=0toea:print#1,chr$(peek(mp+a));:nexta
  145. 1370 print#1,chr$(0);chr$(0);chr$(0);chr$(0):close1:close2:close15
  146. 1380 print"[147]"tab(18)"done!":goto1410
  147. 1400 close1:close2:close15:print"[147][159]"
  148. 1410 printtab(8)"space[159] - run the program again"
  149. 1420 printtab(8)"  l  [159] - return to loadstar"
  150. 1430 geta$:ifa$<>" "anda$<>"l"then1430
  151. 1440 ifa$=" "thenrun
  152. 1450 open15,8,15,"r0:hello connect=hello connect":input#15,er%:close15
  153. 1460 ifer%<>63thenend
  154. 1470 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
  155. 1475 print"[144]run"
  156. 1480 poke631,13:poke632,13:poke198,2
  157. 1500 new
  158. 61000 poke214,15:print""
  159. 61110 print"  [155][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
  160. 61120 print"  [152]                                    "
  161. 61130 print"                                      "
  162. 61140 print"                                      "
  163. 61150 print"        [208]ublished on [204][207][193][196][211][212][193][210] #61     "
  164. 61160 print"      [211]ubscriptions 1-800-831-2694    "
  165. 61170 print"     [195][200][193][206][199][201][206][199][160][212][200][201][211][160][206][207][212][201][195][197][160][201][211][160][201][204][204][197][199][193][204]  "
  166. 61180 print"                                      "
  167. 61190 print"  [151][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
  168. 61200 au$="[205][204] [210]elocater":poke214,17:print:printspc(20-len(au$)/2)"[152]"au$
  169. 61210 au$="[194]y [202]eff [194]abuschak  ([195]) 1989":poke214,18:print
  170. 61220 printspc(20-len(au$)/2)"[152]"au$""
  171. 61230 print""
  172. 61240 printtab(10)"[159][205] [204]    [210] [197] [204] [207] [195] [193] [212] [197] [210]"
  173. 61245 print"[154]   from [195]ommodore [205]agazine - [202]une 1989"
  174. 61247 p